import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import upload from "@dfeidao/atom-web/file/upload";
import { productid } from '../../atom/config';


import set from '@dfeidao/atom-web/local/set';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// 上传文件
	const jd = fd.data.node.querySelector<HTMLInputElement>('[data-id="ss"]');
	const f = await upload(productid, jd) as { _id: string };
	const ff = f._id;
	set(fd, 'ff', ff);
	console.log("结果++》", ff);


}

// {_id: "c784a6ed-5211-4775-83c7-ae6b518aa0e5", length: 10391, chunkSize: 261120, uploadDate: "2019-03-08T06:32:31.429Z", filename: "c784a6ed-5211-4775-83c7-ae6b518aa0e5.xlsx", …}
// chunkSize: 261120
// contentType: "application/octet-stream"
// filename: "c784a6ed-5211-4775-83c7-ae6b518aa0e5.xlsx"
// length: 10391
// md5: "9218516b2988421d0f721203965d5d56"
// metadata:
// originialFileName: "数据架构.xlsx.xlsx"
// productid: "feidao_mes"
// __proto__: Object
// uploadDate: "2019-03-08T06:32:31.429Z"
// _id: "c784a6ed-5211-4775-83c7-ae6b518aa0e5"